package com.taijihuabao.modules.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.taijihuabao.common.commonutils.LongToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户-角色中间表
 *
 * @author changhui.tu
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("用户-角色中间表")
public class UserRoleEntity extends BaseEntity {

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = LongToStringSerializer.class)
    private Long id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户Id")
    @JsonSerialize(using = LongToStringSerializer.class)
    private Long uid;

    /**
     * 角色id
     */
    @ApiModelProperty(value = "角色Id")
    @JsonSerialize(using = LongToStringSerializer.class)
    private Long rid;


    public UserRoleEntity() {
    }

    public UserRoleEntity(Long uid, Long rid) {
        this.uid = uid;
        this.rid = rid;
    }

}
